 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Cloud Cabinet Service API
提供云托管服务的相关接口

OpenAPI spec version: v1
Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKJdccs/JdccsExecutor.h>

@implementation JdccsClient

@synthesize userAgent = _userAgent;
@synthesize serviceName = _serviceName;
@synthesize version = _version;

-(void) addCustomerHeaderWithKey:(NSString*) key
                           value:(NSString*) value{
    if(![self customHeader])
    {
        self.customHeader = [[NSMutableDictionary alloc] init];
    }
    if(key && value)
    {
        [[self customHeader] setValue:value forKey:key];
    }
   
}

-(id)initWithGlobalConfig{
    if(![GlobalConfig credential])
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@"GlobalConfig credential not config" userInfo:nil];
        @throw e;
    }
    self.credential = [GlobalConfig credential];
    if(![GlobalConfig sdkEnvironment])
    {
        self.sdkEnvironment = [[SDKEnvironment alloc] initWithEndPoint:@"jdccs.jdcloud-api.com"];
    }else
    {
        self.sdkEnvironment = [GlobalConfig sdkEnvironment];
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 jdccs  v1";
    _serviceName = @"jdccs";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}

-(id)initWithCredential:(Credential*)credential
         sdkEnvironment:(SDKEnvironment*)sdkEnvironment
{
    if(!credential)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" credential can not null" userInfo:nil];
        @throw e;
    }else{
        self.credential = credential;
    }
    
    if(!sdkEnvironment)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" sdkEnvironment can not null" userInfo:nil];
        @throw e;
    }else{
        self.sdkEnvironment = sdkEnvironment;
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 jdccs  v1";
    _serviceName = @"jdccs";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}

-(id)initWithCredential:(Credential*)credential
{
    if(!credential)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" credential can not null" userInfo:nil];
        @throw e;
    }else{
        self.credential = credential;
    }
    if(![GlobalConfig sdkEnvironment])
    {
        self.sdkEnvironment = [[SDKEnvironment alloc] initWithEndPoint:@"jdccs.jdcloud-api.com"];
    }else
    {
        self.sdkEnvironment = [GlobalConfig sdkEnvironment];
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 jdccs  v1";
    _serviceName = @"jdccs";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}

-(id)init{
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 jdccs  v1";
    _serviceName = @"jdccs";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}


/**
describeMetricData sync request
@param describeMetricDataRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeMetricDataResponse` the request response data model
*/
-(NSDictionary*) describeMetricDataSyncWithRequest:(JdccsDescribeMetricDataRequest*) describeMetricDataRequest
{
JdccsDescribeMetricDataExecutor* excutor = [[JdccsDescribeMetricDataExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeMetricDataRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdccsDescribeMetricDataResponse* response = [[JdccsDescribeMetricDataResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeMetricDataResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeMetricDataAsyncWithRequest:(JdccsDescribeMetricDataRequest*) describeMetricDataRequest
                       completionHandler:(void(^)(int statusCode,JdccsDescribeMetricDataResponse* _Nullable describeMetricDataResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
JdccsDescribeMetricDataExecutor* excutor = [[JdccsDescribeMetricDataExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeMetricDataRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdccsDescribeMetricDataResponse* response = [[JdccsDescribeMetricDataResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
lastDownsample sync request
@param lastDownsampleRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `lastDownsampleResponse` the request response data model
*/
-(NSDictionary*) lastDownsampleSyncWithRequest:(JdccsLastDownsampleRequest*) lastDownsampleRequest
{
JdccsLastDownsampleExecutor* excutor = [[JdccsLastDownsampleExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:lastDownsampleRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdccsLastDownsampleResponse* response = [[JdccsLastDownsampleResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"lastDownsampleResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)lastDownsampleAsyncWithRequest:(JdccsLastDownsampleRequest*) lastDownsampleRequest
                       completionHandler:(void(^)(int statusCode,JdccsLastDownsampleResponse* _Nullable lastDownsampleResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
JdccsLastDownsampleExecutor* excutor = [[JdccsLastDownsampleExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:lastDownsampleRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdccsLastDownsampleResponse* response = [[JdccsLastDownsampleResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeMetrics sync request
@param describeMetricsRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeMetricsResponse` the request response data model
*/
-(NSDictionary*) describeMetricsSyncWithRequest:(JdccsDescribeMetricsRequest*) describeMetricsRequest
{
JdccsDescribeMetricsExecutor* excutor = [[JdccsDescribeMetricsExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeMetricsRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdccsDescribeMetricsResponse* response = [[JdccsDescribeMetricsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeMetricsResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeMetricsAsyncWithRequest:(JdccsDescribeMetricsRequest*) describeMetricsRequest
                       completionHandler:(void(^)(int statusCode,JdccsDescribeMetricsResponse* _Nullable describeMetricsResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
JdccsDescribeMetricsExecutor* excutor = [[JdccsDescribeMetricsExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeMetricsRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdccsDescribeMetricsResponse* response = [[JdccsDescribeMetricsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeRooms sync request
@param describeRoomsRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeRoomsResponse` the request response data model
*/
-(NSDictionary*) describeRoomsSyncWithRequest:(JdccsDescribeRoomsRequest*) describeRoomsRequest
{
JdccsDescribeRoomsExecutor* excutor = [[JdccsDescribeRoomsExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeRoomsRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdccsDescribeRoomsResponse* response = [[JdccsDescribeRoomsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeRoomsResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeRoomsAsyncWithRequest:(JdccsDescribeRoomsRequest*) describeRoomsRequest
                       completionHandler:(void(^)(int statusCode,JdccsDescribeRoomsResponse* _Nullable describeRoomsResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
JdccsDescribeRoomsExecutor* excutor = [[JdccsDescribeRoomsExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeRoomsRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdccsDescribeRoomsResponse* response = [[JdccsDescribeRoomsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeBandwidthTraffic sync request
@param describeBandwidthTrafficRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeBandwidthTrafficResponse` the request response data model
*/
-(NSDictionary*) describeBandwidthTrafficSyncWithRequest:(JdccsDescribeBandwidthTrafficRequest*) describeBandwidthTrafficRequest
{
JdccsDescribeBandwidthTrafficExecutor* excutor = [[JdccsDescribeBandwidthTrafficExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeBandwidthTrafficRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdccsDescribeBandwidthTrafficResponse* response = [[JdccsDescribeBandwidthTrafficResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeBandwidthTrafficResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeBandwidthTrafficAsyncWithRequest:(JdccsDescribeBandwidthTrafficRequest*) describeBandwidthTrafficRequest
                       completionHandler:(void(^)(int statusCode,JdccsDescribeBandwidthTrafficResponse* _Nullable describeBandwidthTrafficResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
JdccsDescribeBandwidthTrafficExecutor* excutor = [[JdccsDescribeBandwidthTrafficExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeBandwidthTrafficRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdccsDescribeBandwidthTrafficResponse* response = [[JdccsDescribeBandwidthTrafficResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeBandwidthTraffics sync request
@param describeBandwidthTrafficsRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeBandwidthTrafficsResponse` the request response data model
*/
-(NSDictionary*) describeBandwidthTrafficsSyncWithRequest:(JdccsDescribeBandwidthTrafficsRequest*) describeBandwidthTrafficsRequest
{
JdccsDescribeBandwidthTrafficsExecutor* excutor = [[JdccsDescribeBandwidthTrafficsExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeBandwidthTrafficsRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdccsDescribeBandwidthTrafficsResponse* response = [[JdccsDescribeBandwidthTrafficsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeBandwidthTrafficsResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeBandwidthTrafficsAsyncWithRequest:(JdccsDescribeBandwidthTrafficsRequest*) describeBandwidthTrafficsRequest
                       completionHandler:(void(^)(int statusCode,JdccsDescribeBandwidthTrafficsResponse* _Nullable describeBandwidthTrafficsResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
JdccsDescribeBandwidthTrafficsExecutor* excutor = [[JdccsDescribeBandwidthTrafficsExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeBandwidthTrafficsRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdccsDescribeBandwidthTrafficsResponse* response = [[JdccsDescribeBandwidthTrafficsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeIdcs sync request
@param describeIdcsRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeIdcsResponse` the request response data model
*/
-(NSDictionary*) describeIdcsSyncWithRequest:(JdccsDescribeIdcsRequest*) describeIdcsRequest
{
JdccsDescribeIdcsExecutor* excutor = [[JdccsDescribeIdcsExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeIdcsRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdccsDescribeIdcsResponse* response = [[JdccsDescribeIdcsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeIdcsResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeIdcsAsyncWithRequest:(JdccsDescribeIdcsRequest*) describeIdcsRequest
                       completionHandler:(void(^)(int statusCode,JdccsDescribeIdcsResponse* _Nullable describeIdcsResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
JdccsDescribeIdcsExecutor* excutor = [[JdccsDescribeIdcsExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeIdcsRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdccsDescribeIdcsResponse* response = [[JdccsDescribeIdcsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeCabinets sync request
@param describeCabinetsRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeCabinetsResponse` the request response data model
*/
-(NSDictionary*) describeCabinetsSyncWithRequest:(JdccsDescribeCabinetsRequest*) describeCabinetsRequest
{
JdccsDescribeCabinetsExecutor* excutor = [[JdccsDescribeCabinetsExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeCabinetsRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdccsDescribeCabinetsResponse* response = [[JdccsDescribeCabinetsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeCabinetsResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeCabinetsAsyncWithRequest:(JdccsDescribeCabinetsRequest*) describeCabinetsRequest
                       completionHandler:(void(^)(int statusCode,JdccsDescribeCabinetsResponse* _Nullable describeCabinetsResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
JdccsDescribeCabinetsExecutor* excutor = [[JdccsDescribeCabinetsExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeCabinetsRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdccsDescribeCabinetsResponse* response = [[JdccsDescribeCabinetsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}


 /**
 jdccs common sync request
 @param  jdcloudDataRequest request param
 @return key `statusCode` http request status code type is int
             `dataResult` the http request response data  type is NSData
             `requestError` the request error type is NSError
 */
 -(NSDictionary*) jdccsCommonSyncWithRequest:(JDCloudDataRequest*) jdcloudDataRequest
                                                   url:(NSString*) url
                                                method:(NSString*) method{
    CommonExecutor* excutor = [[CommonExecutor alloc] initWithJDCloudClient:self url:url method:method];
    NSDictionary* responseResult = [excutor executeDataSync:jdcloudDataRequest];
    return responseResult;
}

-(void)jdccsCommonAsyncWithRequest:(JDCloudDataRequest*) jdcloudDataRequest
                                         url:(NSString*) url
                                      method:(NSString*) method
                           completionHandler:(void(^)(int statusCode, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
     CommonExecutor* excutor = [[CommonExecutor alloc] initWithJDCloudClient:self url:url method:method];
    
    [excutor executeDataAsync:jdcloudDataRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        completionHandler(statusCode,responseData,error);
    }];
} 

@end
